<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/21
 * Time: 14:55
 */
$content = file_get_contents("http://365jia.cn/");
//echo $content;
if(preg_match_all('/src="(.*?.jpg)"/',$content,$m)){
//    var_dump($m[1]);
    $i=0;
    foreach($m[1] as $item){
        if (stripos('http://',$item)===false){
            $url = 'http://365jia.cn'.$item;
        } else {
            $url = $item;
        }
//        var_dump($url);
        $fileName = substr(strrchr($url,'/'),1);
        $fileFullName = __DIR__."/365pic/".$fileName;

        $pic = file_get_contents($url);
        var_dump($fileFullName);
        file_put_contents($fileFullName,$pic);
//        break;
    }

//http://365jia.cn/uploads/17/0921/59c316b2a7252.jpg
}